//
//  TaskWithHomeSearch.m
//  DuBai
//
//  Created by lt on 14-4-1.
//  Copyright (c) 2014年 darktm. All rights reserved.
//

#import "TaskWithHomeSearch.h"

#import "SearchRsult.h"
#import "Search.h"

@implementation TaskWithHomeSearch

-(void)prepare{
    
    NSMutableDictionary *mDic = [NSMutableDictionary dictionaryWithCapacity:3];
    [mDic setValue:self.key forKey:@"key"];
    [mDic setValue:self.startNum forKey:@"start"];
    
    [self startAsyncWithParams:mDic withMethod:@"POST" withURL:[Configure homeSearch]];
}

-(id)parese{
    
    NSMutableArray *ret = [NSMutableArray array];
    
    for (NSDictionary *dic in self.rcvData[@"docs"]) {
        Search *c = [[Search alloc] initWithReflectData:dic];
        [ret addObject:c];
    }
    
    SearchRsult *rsult = [[SearchRsult alloc] init];
    rsult.count = [NSString stringWithFormat:@"%@",self.rcvData[@"nums"]];
    rsult.rsultArray = ret;
    
    return rsult;
}


@end
